package com.lkm.market2_0.m_imple.steelyardstatus;

import com.lkm.frame.module.ConditionConfige;
import com.lkm.frame.module.ModuleDelegate;
import com.lkm.frame.module.ModuleManager;
import com.lkm.market2_0.m.steelyarddata.SteelyardDataModule;
import com.lkm.market2_0.m.steelyardstatus.SteelyardStatusManagerModule;



public class SteelyardStatusModuleDelegate implements ModuleDelegate<SteelyardStatusManagerModule ,Void>{


    private ModuleManager mModuleManager;
    @Override
    public void init(ModuleManager moduleManager) {
        this.mModuleManager=moduleManager;

    }

    @Override
    public void dependency(DependencyConfig dc) {
        dc.addDependency(SteelyardDataModule.class);
    }

    @Override
    public void configure(ConditionConfige<Void> cc) {

    }

    @Override
    public SteelyardStatusManagerModule execute(Void aVoid) {
        SteelyardDataModule steelyardDataModule=mModuleManager.loadModule(SteelyardDataModule.class);
        SteelyardStatusModuleImple steelyardStatusModuleImple=new SteelyardStatusModuleImple(steelyardDataModule);
        steelyardStatusModuleImple.startTimingUp();
        return steelyardStatusModuleImple;
    }

    @Override
    public Class<SteelyardStatusManagerModule> getModuleInterfaceClass() {
        return SteelyardStatusManagerModule.class;
    }

    @Override
    public void onError(ErrorWarp e) {

    }
}
